\(\int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx\) [116]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 27 \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=-\frac {2 a \tan (c+d x)}{d \sqrt {a-a \sec (c+d x)}} \]

[Out]

-2*a*tan(d*x+c)/d/(a-a*sec(d*x+c))^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.045, Rules used = {3877} \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=-\frac {2 a \tan (c+d x)}{d \sqrt {a-a \sec (c+d x)}} \]

[In]

Int[Sec[c + d*x]*Sqrt[a - a*Sec[c + d*x]],x]

[Out]

(-2*a*Tan[c + d*x])/(d*Sqrt[a - a*Sec[c + d*x]])

Rule 3877

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*b*(Cot[e + f*x]/(
f*Sqrt[a + b*Csc[e + f*x]])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 a \tan (c+d x)}{d \sqrt {a-a \sec (c+d x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.11 \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=\frac {2 \cot \left (\frac {1}{2} (c+d x)\right ) \sqrt {a-a \sec (c+d x)}}{d} \]

[In]

Integrate[Sec[c + d*x]*Sqrt[a - a*Sec[c + d*x]],x]

[Out]

(2*Cot[(c + d*x)/2]*Sqrt[a - a*Sec[c + d*x]])/d

Maple [A] (verified)

Time = 0.86 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.30

method result size
default \(-\frac {2 \sqrt {-a \left (\sec \left (d x +c \right )-1\right )}\, \sin \left (d x +c \right )}{d \left (\cos \left (d x +c \right )-1\right )}\) \(35\)

[In]

int(sec(d*x+c)*(a-a*sec(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2/d*(-a*(sec(d*x+c)-1))^(1/2)*sin(d*x+c)/(cos(d*x+c)-1)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.63 \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=\frac {2 \, \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} {\left (\cos \left (d x + c\right ) + 1\right )}}{d \sin \left (d x + c\right )} \]

[In]

integrate(sec(d*x+c)*(a-a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

2*sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*(cos(d*x + c) + 1)/(d*sin(d*x + c))

Sympy [F]

\[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=\int \sqrt {- a \left (\sec {\left (c + d x \right )} - 1\right )} \sec {\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)*(a-a*sec(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(-a*(sec(c + d*x) - 1))*sec(c + d*x), x)

Maxima [F]

\[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=\int { \sqrt {-a \sec \left (d x + c\right ) + a} \sec \left (d x + c\right ) \,d x } \]

[In]

integrate(sec(d*x+c)*(a-a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(-a*sec(d*x + c) + a)*sec(d*x + c), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (25) = 50\).

Time = 0.56 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.11 \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=-\frac {2 \, \sqrt {2} a \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}{\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a} d} \]

[In]

integrate(sec(d*x+c)*(a-a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-2*sqrt(2)*a*sgn(tan(1/2*d*x + 1/2*c)^3 + tan(1/2*d*x + 1/2*c))*sgn(cos(d*x + c))/(sqrt(a*tan(1/2*d*x + 1/2*c)
^2 - a)*d)

Mupad [B] (verification not implemented)

Time = 13.59 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.33 \[ \int \sec (c+d x) \sqrt {a-a \sec (c+d x)} \, dx=\frac {\sin \left (c+d\,x\right )\,\sqrt {a-\frac {a}{\cos \left (c+d\,x\right )}}}{d\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2} \]

[In]

int((a - a/cos(c + d*x))^(1/2)/cos(c + d*x),x)

[Out]

(sin(c + d*x)*(a - a/cos(c + d*x))^(1/2))/(d*sin(c/2 + (d*x)/2)^2)